{% extends "layout" %}

{% block local %}<div id="local">
	{% if tests %}
	{% if tests.getstatus %}<div class="pass">
		<h3 class="has_tests">Unit tests</h3>
		<p class="tests_pass">{{ tests.getpasscount }} successful tests.</p>
		<p class="details"><a href="kit/{{ kit.getid }}/tests">see details</a>.</p>
		</div>
	{% else %}<div class="fail">
		<h3 class="tests_fails">Unit tests</h3>
		<p class="tests_error">{{ tests.getfailcount }} tests failed.</p>
		<p class="tests_exception">{{ tests.getexceptioncount }} exceptions</p>
		<p class="details"><a href="kit/{{ kit.getid }}/tests">see details</a>.</p>
	</div>{% endif %}{% endif %}

	<p><a href="kit/{{ kit.getid }}/cfg" class="cfg">Edit kit's configuration</a></p>

{% comment %} tools list and config {% endcomment %}
{% if kit.listtools %}	<h3>Tools</h3>
	<dl class="tools">{% for tclass in kit.listtools %}
		<dt><a href="kit/{{ kit.getid }}/toolcfg/{{ forloop.key }}" class="cfg">
			{{ forloop.key }}</a></dt>
		<dd>{{ tclass }}</dd>{% endfor %}
	</dl>{% endif %}


</div>{% endblock %}

{% block main %}
	<h2>Kit {{ kit.getid }} {{ kit.getversion }} </h2>
	<p>{{ kit.getdescription }}</p>

{% switch kit.getstatus %}
	{% case "missing_kit" %}<p class="alert">Ce kit requiert des kits absents</p>{% endcase %}
	{% case "bad_php" %}<p class="alert">Ce kit n'est pas compatible avec la version courante de PHP</p>{% endcase %}
{% endswitch %}

	{% if kit.getlink %}<p><a href="{{ kit.link }}">web site</a></p>{% endif %}

	{% if kit.phpversion %}
		<p>PHP versions supported : {{ kit.phpversion }}</p>
	{% endif %}

	{% if kit.listsubkits %}{% include "kitlist" kits=kit.getsubkits %}{% endif %}

	{% if kit.dependencies %}<div class="dependencies">
	<h3>Required Kits</h3>
	{% include "kitlist" kits=kit.dependencies %}
	</div>{% endif %}

	{% if cfg.load_files %}<div class="files">
	<h3>Included library files</h3>
	<dl>{% for file in cfg.load_files %}
		<dt>{{ file }}</dt>{% endfor %}
	</dl>
	</div>{% endif %}

	{% comment %}<p>view kit</p>
	<pre>{{ kit|dump }}</pre>{% endcomment %}
{% endblock %}
